﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XYZshell.Game.CardGameEngine
{
	public  class Setter:FlowActivity
	{
		public Setter() : base()
		{
		}

		public override void Start()
		{
			object val=ValueParam.Value;
			OnStarted( new SetterEventArgs
			{
				Value = val,
				Path = Path,
				Previous = Previous,
				Next = Next,
			} );

			GameContext.SetValue( Path, val );
			OnFinished( new SetterEventArgs
			{
				Value = val,
				Path = Path,
				Previous = Previous,
				Next = Next,
			} );
		}

		public string Path
		{
			get;
			set;
		}
		public ExpressionParam ValueParam
		{
			get;
			set;
		}

	}
	public class SetterEventArgs : FlowEventArgs
	{
		public string Path
		{
			get;
			set;
		}
		public object Value
		{
			get;
			set;
		}

	}
}
